#!/bin/bash

# frappev15版本中,系统镜像的版本不是bullseye，apt替换源的操作需要修改，这里反正用不到，就算了
# echo '当前apt source👇'
# cat /etc/apt/sources.list
# echo '替换APT源为国内的源'
# sed -i '1i\deb http://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free' /etc/apt/sources.list
# sed -i '2i\deb http://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free' /etc/apt/sources.list
# sed -i '3i\deb http://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free' /etc/apt/sources.list
# sed -i '4i\deb http://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free' /etc/apt/sources.list
# echo '添加了国内apt source'
# cat /etc/apt/sources.list

echo '当前pip source👇'
cat /etc/pip.conf && echo "" #cat后打印空行，用以换行
sudo cp ./a/pip.conf /etc/pip.conf
echo '修改后pip source👇'
cat /etc/pip.conf && echo "" #cat后打印空行，用以换行

# 如果是用pyenv install是否也要修改源，怎么改？

echo "当前npm源👇"
npm config get registry
npm config set registry https://registry.npmmirror.com:443
npm config set strict-ssl false
echo "修改后npm源👇"
npm config get registry

echo "当前yarn源👇"
yarn config get registry
yarn config set registry https://registry.npmmirror.com:443
yarn config set strict-ssl false

echo "修改后yarn源👇"
yarn config get registry


# 给脚本执行权限：
# chmod +x apt_source_change.sh
